Skip to content

Fix Python 3.15 smoke tests on Windows and Linux - #8357

Merged
atalman merged 1 commit into
pytorch:mainfrom
atalman:atalman/win-python-3.15
Aug 5, 2026
Merged

Fix Python 3.15 smoke tests on Windows and Linux#8357
atalman merged 1 commit into
pytorch:mainfrom
atalman:atalman/win-python-3.15

Conversation

@atalman

@atalman atalman commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

numpy publishes no cp315 wheels on PyPI, so installing a freshly built wheel under 3.15 / 3.15t falls back to the numpy sdist and tries to build it from source. On Windows that build fails outright in the conda env:

..\meson.build:1:0: ERROR: Cython requires python3 dependency for link testing, but it could not be found
error: metadata-generation-failed

so pip install <wheel> aborts, the wheel is never installed, and the smoke test reports ModuleNotFoundError: No module named 'torchvision' — a symptom two steps removed from the cause.

cp315 wheels for both numpy and pillow are published on download.pytorch.org across cpu / cu126 / cu128 / cu129 / cu130 / xpu, so for 3.15 / 3.15t this resolves runtime deps from there with --pre (numpy is currently 2.6.0.dev0). All other Python versions install from PyPI exactly as before.

Changes

  • Windows (build_wheels_windows.yml) — both the X64 and ARM64 smoke tests.
  • Linux (build_wheels_linux.yml) — re-enables the 3.15 smoke test, which was skipped for exactly this reason, and applies the same dependency resolution. Re-enabling it without that would just relocate the failure, since numpy still has no cp315 wheels on PyPI.

--index-url (rather than --extra-index-url) replaces PyPI for that install, so every torchvision runtime dependency has to be present on the pytorch index. Verified for torch, numpy and pillow with cp315 win_amd64, win_arm64 and manylinux builds across all of the indices listed above.

Dropped from the earlier revision

The generate_binary_build_matrix.py and matrix-test changes are gone. #8427 has since enabled 3.15 / 3.15t by default for every OS and removed the opt-in include_preview_python_versions mechanism those hunks extended, so they are obsolete. The [DO NOT MERGE] PR-build override is also dropped.

Follow-up

This fixes CI only. A user running pip install torchvision on Python 3.15 still cannot satisfy the numpy dependency from PyPI, so 3.15 remains effectively nightly-only until upstream numpy ships cp315 wheels.

@vercel

vercel Bot commented Jul 23, 2026

Copy link
Copy Markdown

@atalman is attempting to deploy a commit to the Meta Open Source Team on Vercel.

A member of the Team first needs to authorize it.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 23, 2026
@atalman
atalman marked this pull request as ready for review July 23, 2026 13:28
@atalman
atalman force-pushed the atalman/win-python-3.15 branch 6 times, most recently from aa56d95 to decc479 Compare July 23, 2026 15:19
# (e.g. pillow, a hard torchvision dependency) that have no cp315 wheels
# yet and fail to build from sdist. Re-enable once the ecosystem ships
# cp315 wheels.
if: ${{ inputs.run-smoke-test && ! startsWith(matrix.python_version, '3.15') }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this for the linux wheel?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @albanD yes, let me change description of the PR. I believe temporary change was committed here #8148 - which skipped smoke testing for 3.15 . We actually want to do some testing for 3.15 hence included it here

)
self.assertNotIn("3.15", versions)
self.assertNotIn("3.15t", versions)
def test_preview_python_versions_excluded_on_macos(self):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this dead code? You changed the name, but no caller.

@atalman
atalman force-pushed the atalman/win-python-3.15 branch 2 times, most recently from 1dc4023 to 2d4facb Compare July 23, 2026 15:30
@atalman atalman changed the title Enable Python 3.15 / 3.15t for Windows wheel builds Enable Python 3.15 / 3.15t for Windows wheel builds. Fix smoke test of linux wheel Jul 23, 2026
@atalman
atalman requested a review from albanD July 23, 2026 15:39
@atalman
atalman force-pushed the atalman/win-python-3.15 branch 3 times, most recently from 2ef0eb9 to 4375c56 Compare July 23, 2026 15:57
atalman added a commit that referenced this pull request Jul 24, 2026
…rch.org (#8362)

## Summary

numpy does not yet publish cp315 wheels on PyPI, so torch preview-Python
(3.15 / 3.15t) wheel builds and smoke tests fail when pip tries to
resolve numpy and falls back to building it from an sdist. This adds
tooling to pre-build numpy and host it on download.pytorch.org so those
installs resolve a real wheel.

Related: #8357 (which currently works around the missing numpy with
`--no-deps`).

## What this adds

- **`.github/workflows/build-numpy-preview.yml`** — `workflow_dispatch`
workflow, matrix over both arches:
  - x86_64 → `linux.2xlarge` + `pytorch/manylinux2_28-builder:cpu`
- aarch64 → `linux.arm64.m8g.4xlarge` +
`pytorch/manylinux2_28_aarch64-builder:cpu-aarch64`
- Inputs: `numpy_version` (default `2.5.1`), `python_versions` (default
`3.15 3.15t`), `channel` (`nightly`/`test`, selects the matching IAM
role), `manywheel_version`, `dry_run` (default **true**).
- **`.github/scripts/build_numpy_preview.sh`** — builds numpy from sdist
against each `/opt/python/cp315*` interpreter, repairs with `auditwheel
repair --plat manylinux_2_28_<arch>`, and uploads to
`s3://pytorch/whl/<channel>/` with `--acl public-read` +
`checksum-sha256` metadata (matching the binary upload workflow).

After a real (non-dry) run, the existing hourly `update-s3-html`
workflow republishes the `whl/<channel>` package indices to include
numpy.

## Testing

- Defaults to `dry_run=true` (build-only, no upload) for a first sanity
check.
numpy does not publish cp315 wheels on PyPI, so installing a freshly built
wheel under 3.15 / 3.15t falls back to the numpy sdist and tries to build it
from source. On Windows that build fails outright in the conda env (meson:
"Cython requires python3 dependency for link testing"), so the wheel is never
installed and the smoke test reports ModuleNotFoundError.

cp315 wheels for both numpy and pillow are published on download.pytorch.org
across cpu / cu126 / cu128 / cu129 / cu130 / xpu, so for 3.15 / 3.15t resolve
runtime deps from there with --pre (numpy is 2.6.0.dev0). All other Python
versions keep installing from PyPI unchanged.

Windows: applies to both the X64 and ARM64 smoke tests.
Linux: re-enables the smoke test for 3.15, which was skipped for this exact
reason, and applies the same dependency resolution.

The binary-build-matrix changes from the earlier revision of this PR are
dropped: pytorch#8427 has since enabled 3.15 / 3.15t by default for every OS and
removed the opt-in preview mechanism they were built on.
@atalman
atalman force-pushed the atalman/win-python-3.15 branch from f3647e1 to c20124b Compare August 5, 2026 00:33
@atalman atalman changed the title Enable Python 3.15 / 3.15t for Windows wheel builds. Fix smoke test of linux wheel Fix Python 3.15 smoke tests on Windows and Linux Aug 5, 2026
@atalman
atalman force-pushed the atalman/win-python-3.15 branch from 80330f8 to c20124b Compare August 5, 2026 01:05
@atalman
atalman merged commit fc982f6 into pytorch:main Aug 5, 2026
39 of 123 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants